﻿using System;
namespace NEATlib
{
    public class ConnectionGene:ICloneable
    {
        private int _innovationNumber;

        private double _weight;
        private int _inputNeuronId;
        private int _outputNeuronId;

        public ConnectionGene(int inputNeuronID, int outputNeuronID, double weight, int innovationNumber)
        {
            IsDisabled = false;
            InputNeuronId = inputNeuronID;
            OutputNeuronId = outputNeuronID;
            _weight = weight;
            _innovationNumber = innovationNumber;
        }

        public int InnovationNumber
        {
            get { return _innovationNumber; }
            set { _innovationNumber = value; }
        }

        public int InputNeuronId
        {
            get { return _inputNeuronId; }
            set { _inputNeuronId = value; }
        }

        public bool IsDisabled { get; set; }

        public int OutputNeuronId
        {
            get { return _outputNeuronId; }
            set { _outputNeuronId = value; }
        }

        public double Weight
        {
            get { return _weight; }
            set { _weight = value; }
        }

        public object Clone()
        {
            var connection = new ConnectionGene(InputNeuronId,
                                        OutputNeuronId,
                                        _weight,
                                        _innovationNumber);
            connection.IsDisabled = IsDisabled;
            return connection;
        }
    }
}